/*
 * MinLength.java
 * 
 * Created on 22-Aug-2007, 18:42:43
 * 
 * Copyright (C)
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 */

package com.grubby.databean.constraints.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * A minimum value constraint for numerics. Constrains numerical properties
 * to being no less in value than that specified for this constraint.
 * <P>
 * The following shows an example of how to apply this constraint.
 * <pre>
 * <code>@MinInclusive(23.45692)
 * public void setADouble(double aDouble) { ... }
 * </code>
 * </pre> 
 * <P>
 * Note: The minimum value is stored as a double regardless of what type
 * of numeric this constraint is applied to. Values of type long, that exceed
 * the precision of double will lose information during the conversion to double.
 * </p>
 * <p>
 * Note: This has been adapted from an Annotation processing example created by 
 * Anders Holmgren of Sun Microsystems
 *
 * @author Anders Holmgren, with alterations by A. HARMEL-LAW. 
 * E: andrew.harmel.law@gmail.com
 */
@Constraint(Constraint.Type.NUMERIC)
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MinInclusive {
    
    /**
     * The minimum allowable value for the numerical value of the
     * property that the constraint is associated with.
     */
    double value();
    
}
